VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form FrmThongKeMonHoc 
   Caption         =   "Thong ke mon hoc"
   ClientHeight    =   8580
   ClientLeft      =   120
   ClientTop       =   450
   ClientWidth     =   12000
   LinkTopic       =   "Form1"
   ScaleHeight     =   8580
   ScaleWidth      =   12000
   StartUpPosition =   3  'Windows Default
   Begin VB.Frame Frame 
      Caption         =   "Thong tin chi tiet"
      Height          =   2055
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   11775
      Begin VB.TextBox txtHocKy 
         Height          =   375
         Left            =   7560
         TabIndex        =   9
         Top             =   960
         Width           =   3615
      End
      Begin VB.CommandButton btnChonNganh 
         Caption         =   "..."
         Height          =   375
         Left            =   5280
         TabIndex        =   8
         Top             =   480
         Width           =   375
      End
      Begin VB.TextBox txtSoHT 
         Height          =   375
         Left            =   1800
         TabIndex        =   6
         Top             =   960
         Width           =   3855
      End
      Begin VB.TextBox txtTenNganh 
         Height          =   375
         Left            =   1800
         TabIndex        =   4
         Top             =   480
         Width           =   3375
      End
      Begin VB.CommandButton btnThongKe 
         Caption         =   "Thong ke"
         Height          =   435
         Left            =   9960
         TabIndex        =   1
         Top             =   1440
         Width           =   1215
      End
      Begin VB.Label Label5 
         Caption         =   "Hoc ky"
         Height          =   255
         Left            =   6360
         TabIndex        =   10
         Top             =   1080
         Width           =   975
      End
      Begin VB.Label Label4 
         Caption         =   "So hoc trinh"
         Height          =   255
         Left            =   600
         TabIndex        =   7
         Top             =   1080
         Width           =   975
      End
      Begin VB.Label Label3 
         Caption         =   "Nganh"
         Height          =   255
         Left            =   600
         TabIndex        =   5
         Top             =   600
         Width           =   975
      End
   End
   Begin MSComctlLib.ListView lstvData 
      Height          =   5775
      Left            =   120
      TabIndex        =   2
      Top             =   2760
      Width           =   11775
      _ExtentX        =   20770
      _ExtentY        =   10186
      View            =   3
      LabelEdit       =   1
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      FullRowSelect   =   -1  'True
      GridLines       =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      Appearance      =   1
      NumItems        =   0
   End
   Begin VB.Label Label 
      Caption         =   "Danh sach lop tim thay"
      Height          =   255
      Index           =   0
      Left            =   240
      TabIndex        =   3
      Top             =   2400
      Width           =   4095
   End
End
Attribute VB_Name = "FrmThongKeMonHoc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private m_ObjADORst  As ADODB.Recordset
Private m_objMH As clsDanhMucMonHoc
Private m_sMaNganh As String
Private WithEvents formNganh As FrmNganh
Attribute formNganh.VB_VarHelpID = -1

Public Sub Init()
    lstvData.ColumnHeaders.Clear
    lstvData.ColumnHeaders.Add , , "Ma MH", lstvData.Width / 5
    lstvData.ColumnHeaders.Add , , "Ten MH", lstvData.Width / 5
    lstvData.ColumnHeaders.Add , , "Ten Nganh", lstvData.Width / 5
    lstvData.ColumnHeaders.Add , , "SoHT", lstvData.Width / 5
    lstvData.ColumnHeaders.Add , , "HocKy", lstvData.Width / 5
End Sub

Private Sub btnChonNganh_Click()
    Set formNganh = New FrmNganh
    formNganh.EnableBtnChon = True
    formNganh.Show 1, Me
End Sub

Private Sub btnThongKe_Click()
    Dim i As Integer
    Dim vLstViewItem As ListItem
    
    If txtTenNganh.Text = "" Then m_sMaNganh = ""
    
    Set m_objMH = New clsDanhMucMonHoc
    Set m_ObjADORst = m_objMH.ThongKe(m_sMaNganh, txtSoHT.Text, txtHocKy.Text)
    lstvData.ListItems.Clear
    i = 1
    
    Do While Not m_ObjADORst.EOF
        Set vLstViewItem = lstvData.ListItems.Add(i)
        vLstViewItem = m_ObjADORst!mamh
        vLstViewItem.SubItems(1) = m_ObjADORst!TenMH
        vLstViewItem.SubItems(2) = m_ObjADORst!tennganh
        vLstViewItem.SubItems(3) = m_ObjADORst!soht
        vLstViewItem.SubItems(4) = m_ObjADORst!hocky
        m_ObjADORst.MoveNext
        i = i + 1
    Loop
End Sub

Private Sub Form_Load()
    Init
End Sub

Private Sub formNganh_EVENTChooseItem(ByVal manganh As String, ByVal tennganh As String)
    m_sMaNganh = manganh
    txtTenNganh.Text = tennganh
End Sub
